//app.js
var utils = require('utils/util.js');
App({
  onLaunch: function () {
   
  },
  makeLogin:function(callback){
	  var that=this;
	  // 登录
	  wx.login({
		  success: res => {
			  // 发送 res.code 到后台换取 openId, sessionKey, unionId
			//  utils.showLoading("正在登陆")
			  utils.http("/api/v1/login/index_wx",{
				  js_code:res.code
			  },function(res){
				  utils.hideLoading();
				  that.globalData.key = res.datas.key;
				  if (typeof callback == 'function') {
					  callback();
				  }
			  })
		  }
	  })
  },
  globalData: {
    userInfo: null,
	http: "https://rongyu.qidian2018.com/index.php/",
  }
})